﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using DAL;
namespace BLL
{
    public class PhotoService
    {
        private PhotosDAL photoDAL = new PhotosDAL();

        public void CreatPhoto(BoPhotos photo)
        {
            photoDAL.Insert(photo);
        }

        public void ModifyPhoto(BoPhotos photo)
        {
            photoDAL.Update(photo);
        }

        public void DeletePhoto(BoPhotos photo)
        {
            photoDAL.Delete(photo.PHO_ID);
        }
      

        public BoPhotos getPhoto(string id)
        {
            return photoDAL.GetModel(id);
        }

        public IList<BoPhotos> GetAllPhotos()
        {
            return photoDAL.GetAllPhotos();
        }
        /// <summary>
        ///通过竞赛的对象从而获取相应的图片列表
        /// </summary>
        /// <param name="contest"></param>
        /// <returns></returns>
        public IList<BoPhotos> GetContestPhotos(BoContests contest)
        {
            return photoDAL.GetContestPhotos(contest.CON_ID);
        }

        public IList<BoPhotos> GetProcedurePhotos(BoProcedures proc)
        {
            return photoDAL.GetProcedurePhotos(proc.PRO_ID);
        }


        /// <summary>
        /// 得到轮显的个数
        /// </summary>
        /// <returns>返回轮显的个数</returns>
        public int GetIsRound()
        {
            return photoDAL.GetIsRound();
        }

        /// <summary>
        /// 得到轮显图片列表
        /// </summary>
        /// <returns>返回轮显图片列表</returns>
        public IList<BoPhotos> GetRoundPhoto()
        {
            return photoDAL.GetRoundPhoto();
        }

    }
}
